02. Big Picture and Intuition
Big Picture and Intuition
In this section, you will learn what a "design pattern" is.
ND079 JPND C2 L03 A02 Big Picture And Intuition V2
SOLID: Principles of Good Software Design
What are the characteristics of good software design? Software engineers have been philosophising about this question since the early days of software development.
SOLID is one of the prevaliing frameworks for thinking about this question. This mnemonic was coined by the American software engineer Robert C. Martin in 2000.
- Single Responsibility Principle
- Open-Closed Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
QUIZ QUESTION::
Match each software design principle with its description.
ANSWER CHOICES:
Description |
Principle |
---|---|
Each class should have only one responsibility. |
|
Software should be open for extension but closed for modification. |
|
Objects that implement the same interface should be interchangeable without breaking the program. |
|
Your code should only depend on interfaces that it actually uses. |
|
All parts of your code should depend on interfaces, or abstractions. Implementation details should depend on interfaces, not the other way around. |
SOLUTION:
Description |
Principle |
---|---|
Your code should only depend on interfaces that it actually uses. |
|
Each class should have only one responsibility. |
|
Software should be open for extension but closed for modification. |
|
All parts of your code should depend on interfaces, or abstractions. Implementation details should depend on interfaces, not the other way around. |
|
Objects that implement the same interface should be interchangeable without breaking the program. |
Design Patterns
A design pattern is a general solution to certain kinds of common design issues that occur in software development.
These patterns provide guidelines for how you can organize and write software. They will not design your code for you — It's still up to you to fill in the blanks and customize each pattern to fit your use case.
This lesson covers three broad categories of software design patterns:
- Creational patterns
- Behavioral patterns
- Structural patterns
Can you figure out what each category means?
QUIZ QUESTION::
Match each design pattern category with its description.
ANSWER CHOICES:
Description |
Design pattern category |
---|---|
Patterns that deal with creating objects. |
|
Patterns that deal with how different objects interact. |
|
Patterns that deal with how different objects fit together. |
SOLUTION:
Description |
Design pattern category |
---|---|
Patterns that deal with creating objects. |
|
Patterns that deal with how different objects fit together. |
|
Patterns that deal with how different objects interact. |